import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
let state = {

    arr: []
}
let getters = {
    g_num(state) {   //传入上面的state
        return state.num + 'getters'
    }
}
let mutations = {
    m_arr(state, a) {
        state.arr.push(a)

    }
}
let actions = {
    a_arr({ commit }, a) {
        commit('m_arr', a)
    }
}
export default new Vuex.Store({
    state,
    getters,
    mutations,
    actions,
})
